package com.hexinfo.dmpro.monitor.dao;

import com.hexinfo.dmpro.monitor.model.base.MonitorReq;
import com.hexinfo.dmpro.monitor.model.cm.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 **/
@Repository
public interface CmStateDao {

    void insertService(Map<String, Object> map);

    void insertServiceNow(Map<String, Object> map);

    void deleteServiceNow(Map<String, Object> map);

    void insertRole(Map<String, Object> map);

    List<ClusterStateInfo> queryAllCluster();

    List<ClusterStateInfo> queryClusterState(StateBaseReqModel model);

    List<Map<String, String>> queryCreateTime();

    List<Map<String, String>> queryCreateTimeRange(Map<String, Object> map);

    List<ServiceStateInfo> queryServiceState(StateBaseReqTimeModel model);

    List<RoleStateInfo> queryRoleState(StateBaseReqTimeModel model);

    List<RoleStateCheckInfo> queryRoleChecks(StateBaseReqModel model);

    //状态监控页面 服务异常次数实时统计信息
    List<ServiceCountInfo> queryServiceRealTime(StateBaseReqModel model);

    List<ServiceCountInfo> queryServiceNullCount(StateBaseReqModel model);

    //状态监控页面 服务异常次数实时统计信息
    List<ServiceCountInfo> seleveryDayInspect();

    List<ServiceStateCount>  queryAllServiceCount();

    List<ServiceStateInfo> queryAllService(MonitorReq req);

    List<Map<String,String>> selectAllHost(MonitorReq monitorBaseModel);

    List<RoleStateCheckInfo> queryRoleStateNow(StateBaseReqModel model);

    //获取集群cpu数
    Long cpuNum(String cmFlag, String clusterFlag);
    //cpu使用率
    List<DistributionDto> cpuUsed(String cmFlag, String clusterFlag,String startTime,String endTime,Long num);
    //cpu分配率
    List<DistributionDto> cpuDistribution(String cmFlag, String clusterFlag,String startTime
            ,String endTime,Long num);
    //获取集群内存数
    Long memoryNum(String cmFlag, String clusterFlag);
    //内存使用率
    List<DistributionDto> memoryUsed(String cmFlag, String clusterFlag,String startTime
            ,String endTime,Long num);
    //内存分配率
    List<DistributionDto> memoryDistribution(String cmFlag, String clusterFlag,String startTime
            ,String endTime,Long num);
    //hdfs使用率
    List<DistributionDto> hdfsUsed(String cmFlag, String clusterFlag,String startTime,String endTime);

    List<ServiceState> queryServiceStateNow(String cmFlag, String clusterFlag);
    String queryHdfsUse(String cmFlag, String clusterFlag);

    List<ServiceState> queryServicesNow(ServiceState serviceState);

    List<ServiceState> queryServices(ServiceState serviceState);
}
